package com.uniview.mvpdemo.mvp;


/**
 * Created by Lenovo on 2017/4/24.
 */

public class MainPresenter implements MainContract.Presenter {

    MainContract.View vMain;

    public MainPresenter(MainContract.View view) {
        vMain = view;
        vMain.setPresenter(this);
    }

    @Override
    public void doClear() {
        vMain.clearEdit();
    }

    @Override
    public void doLogin(String username, String pwd) {
        vMain.onLoading("正在验证...");

        boolean flag = false;

        if (username.equals("zj") && pwd.equals("123456")) {
            flag = true;
        }

        vMain.loadingComplete();

        vMain.login(flag, username, pwd);
    }
}
